<?php
// +----------------------------------------------------------------------
// | OneThink [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.onethink.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: 麦当苗儿 <zuojiazi@vip.qq.com> <http://www.zjzit.cn>
// +----------------------------------------------------------------------

namespace Home\Controller;

/**
 * 下载分享
 * Class DownloadController
 * @package Home\Controller
 */
class DownloadController extends HomeController {

    /**仿百度云
     * @author leiying
     */
	public function index(){
 		$id = I('get.mid');


        if($id){
			
            $data = M('material_url')->where(array('id'=>$id))->find();
            if(!$data['name']){$data['name'] = '文件';}
            $arr = explode('/',$data['url']);
            $i = count($arr)-2;
            $data['time'] = $arr[$i];
//            $data['url'] = 'http://'.$_SERVER['SERVER_NAME'].$data['url'];

            $this->assign('data',$data);
        }
		
		$this->display();
	}



}
